// Styles for code examples are here.

.docs-code,
pre {
  position: relative;

  code {
    display: block;
    overflow-x: auto;
    padding: 1rem;
    padding-right: 4rem;
    background: #f9f9f9;
    margin-bottom: 1.5rem;
  }

  .docs-reference & code {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }
}

.docs-code.kitchen-sink {
  border: $code-border;
  overflow: visible;
  pre {
    max-height: 300px;
    overflow-y: scroll;
  }
  margin-bottom: 1rem;

  code {
    border: 0;
  }
}

.docs-code .bash {
  border: 0;
  background: #333;
  color: white;
  border-radius: 4px;
  position: relative;
  padding-top: 2rem;

  &::before {
    content: '$ ';
    color: #ccc;
  }

  &::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1.25rem;
    background: #777;
    border-radius: 4px 4px 0 0;
  }
}

// Styles for the copy button shown on every code sample
.docs-code-copy {
  position: absolute;
  top: 0;
  right: 0;
  background: $primary-color;
  color: white;
  font-size: 0.8rem;
  padding: 0.75rem 1rem;
  z-index: 1;

  &:hover,
  &.zeroclipboard-is-hover {
    background: scale-color($primary-color, $lightness: -5%);
  }
}

.docs-code-toggle {
  display: block;
  margin-bottom: 1rem;
  font-weight: bold;
}

.docs-code-iframe {
  width: 100%;
  border: 1px solid #cacaca;
  outline: 0;
  margin-bottom: 1rem;
  height: 200px;
}

.docs-code-language {
  color: #999;
  margin-right: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  width: 3em;
  display: inline-block;
  text-transform: uppercase;
}

.docs-code-toggle {
  display: inline-block;
  color: $primary-color;
  font-size: 0.9rem;
  margin-bottom: 1rem;

  &:focus {
    outline: none;
  }
}

.docs-code-wrapper {
  .docs-code {
    clear: both;
  }
}

.docs-code-inky {
  display: none;
}

.is-inky-enabled {
  .docs-code-inky {
    display: block;
  }

  .docs-code-html {
    display: none;
  }
}

.global-zeroclipboard-container {
  z-index: auto !important;
}

// github.com style for highlight.js
// Created by Vasily Polovnyov <vast@whiteants.net>
.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
  color: #333;
  background: #f8f8f8;
  -webkit-text-size-adjust: none;
}

.hljs-comment,
.diff .hljs-header,
.hljs-javadoc {
  color: #998;
  font-style: italic;
}

.hljs-keyword,
.css .rule .hljs-keyword,
.hljs-winutils,
.nginx .hljs-title,
.hljs-subst,
.hljs-request,
.hljs-status {
  color: #333;
  font-weight: bold;
}

.hljs-number,
.hljs-hexcolor,
.ruby .hljs-constant {
  color: #008080;
}

.hljs-string,
.hljs-tag .hljs-value,
.hljs-phpdoc,
.hljs-dartdoc,
.tex .hljs-formula {
  color: #d14;
}

.hljs-title,
.hljs-id,
.scss .hljs-preprocessor {
  color: #900;
  font-weight: bold;
}

.hljs-list .hljs-keyword,
.hljs-subst {
  font-weight: normal;
}

.hljs-class .hljs-title,
.hljs-type,
.vhdl .hljs-literal,
.tex .hljs-command {
  color: #458;
  font-weight: bold;
}

.hljs-tag,
.hljs-tag .hljs-title,
.hljs-rule .hljs-property,
.django .hljs-tag .hljs-keyword {
  color: #000080;
  font-weight: normal;
}

.hljs-attribute,
.hljs-variable,
.lisp .hljs-body,
.hljs-name {
  color: #008080;
}

.hljs-regexp {
  color: #009926;
}

.hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.lisp .hljs-keyword,
.clojure .hljs-keyword,
.scheme .hljs-keyword,
.tex .hljs-special,
.hljs-prompt {
  color: #990073;
}

.hljs-built_in {
  color: #0086b3;
}

.hljs-preprocessor,
.hljs-pragma,
.hljs-pi,
.hljs-doctype,
.hljs-shebang,
.hljs-cdata {
  color: #999;
  font-weight: bold;
}

.hljs-deletion {
  background: #fdd;
}

.hljs-addition {
  background: #dfd;
}

.diff .hljs-change {
  background: #0086b3;
}

.hljs-chunk {
  color: #aaa;
}

.hljs-at_rule {
  color: #333;
}

.hljs-at_rule .hljs-keyword {
  color: #a71d5d;
  font-weight: normal;
}

.hljs-at_rule .hljs-preprocessor {
  color: #0086b3;
  font-weight: normal;
}

.scss .hljs-attribute {
  color: #008080;
}

.scss .hljs-function {
  color: #008080;
}

.scss .hljs-class {
  color: #795da3;
}
